home *** CD-ROM | disk | FTP | other *** search
- Path: drivel.ics.uci.edu!ucivax!gateway
- From: klefstad@catalina.ICS.UCI.EDU ("Raymond Klefstad, Ph.D.")
- Subject: Parameterless functions
- Message-ID: <9601191115.aa06760@paris.ics.uci.edu>
- Date: 19 Jan 96 19:18:31 GMT
- Newsgroups: comp.lang.c++
-
-
- Why does the following function work? Is this just gcc or is it correct
- C++? endl and ends are implemented this way.
-
- #include <iostream.h>
-
- ostream& newline(ostream& out)
- {
- return out << "Hello";
- }
-
- main()
- {
- cout << "Hello" << newline;
- }
-
-
- Also, I noticed the following in some of the standard headers for gcc:
-
- int foo(int x) return y
- {
- y = 10;
- // do stuff and drop of the end of the function, but y is returned
- // similar to Pascal. Is this valid C++ or just GNU extensions.
- }
-